/**
 * Copyright (C) 2015-2018 IQIYI
 * All rights reserved.
 *
 * Author     : 王海斌
 * E-mail     : wanghaibin@qiyi.com
 * Version    :
 * Date       : Thu 24 Jan 2019 03:05:21 PM CST
 * Destription:
 *
 */
#include <iostream>
#include <string>

using namespace std;

std::string GetFileExt(const std::string &file)
{
    std::string ext("NULL");
    size_t findPos = file.find_last_of('.');
    if (findPos != std::string::npos &&
            findPos != file.length() - 1) {
        ext  = file.substr(findPos + 1);
    }
    return ext;
}

int main(int , char *[])
{
    cout << "ext=" << GetFileExt("/asdfasdf/asdfasdf/xx.abc") << endl;
    return 0;
}
